public class HF_MethodCallToPIMSIdMap {
public String sobjectname{set;get;}
public void AssignPIMsId(String id1,Id id2){

        if(id1.equals('001')){
             Account acc=[select Id,Partner_ID__c from Account where Id=:id2];
             PIMS_Reserved_Id__c pimsid=[select Id,Account__c,PIMS_Id__c,Used__c from PIMS_Reserved_Id__c where PIMS_Id__c=:acc.Partner_ID__c];
             pimsid.Account__c=acc.Id;
             pimsid.Used__c=true;
             update pimsid;
        }
       if(id1.equals('003')){
             
            Contact con=[select Id,Partner_Contact_ID__c from Contact where Id=:id2];
             PIMS_Reserved_Id__c pimsid=[select Id,contact__c,PIMS_Id__c,Used__c from PIMS_Reserved_Id__c where PIMS_Id__c=:con.Partner_Contact_ID__c];
             pimsid.contact__c=con.Id;
             pimsid.Used__c=true;
             update pimsid;
        } 
        
       //if(id1.equals('001')){sobjectname='Account';} 
       //if(id1.equals('003')){sobjectname='Contact';} 
       
}
}